<%@ page language="java" import="java.util.*" contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/meta.jsp" %>
<%@ include file="/common/import.jsp" %>
<%@ page import="com.apache.uct.common.ToolsUtil" %>
<%
String attachDomain = "";
String attachServerUrl = "";

attachDomain = ToolsUtil.getInstance().getValueByKey("DOMAIN");
attachServerUrl =  ToolsUtil.getInstance().getValueByKey("atta_server");
 %>
 <script type="text/javascript">    
    var ctx = "<%=attachServerUrl%>";
    //document.domain = '<%=attachDomain%>';
    /*
             无实体上传在网站或者其它外部系统使用时，需设置：
     1.js中链接地址picStoreAction对象的参数isRemote=T
     2.将本页面document.domain 的注释放开
     3.在unity_config.properties中设置参数DOMAIN
	*/
</script>
<!--  <link rel="stylesheet" type="text/css" href="${ctx}/js/easyui/themes/default/easyui.css"> -->
<script type="text/javascript" src="${ctx}/js/easyui/extendvalidate.js"></script>
<script type="text/javascript" src="${ctx}/js/pic/js/singePicUpload-1.6.js"></script>
    <script type="text/javascript">
    
     myDis = function (idname,flag,ft,msg,murl,surl){
		
		if(flag == "T"){
		     $.messager.alert("上传结果",msg, "info");
		     $("#"+idname).val(murl);
			 if(ft == "pic"){
				 $("#previewImg").attr("src",murl);
			 }
			 clo();
		}else{
			sampleErrorMsg(msg);
		}
    }
     
	function clickAttaSort(type){
	     window.location.href="${ctx}/attachment/media/toSample.action?type="+type;
	}
	</script>
	
<body  style="font-size:12px;font-family: 微软雅黑">
<span>				  
 <input type="radio" name="attaSort" value="0"   onclick="clickAttaSort('0')" />&nbsp;附件
 <input type="radio" name="attaSort" value="2"   onclick="clickAttaSort('2')" />&nbsp;新附件上传
 <input type="radio" name="attaSort" value="1" checked=checked onclick="clickAttaSort('1')" />&nbsp;图片
</span><br/><br/>
	<div id="results"  title="" class="easyui-panel" style="height:450px;padding:5px;" >		
		<span>
			需要必要的dom环境：
			<p>需要引入easyui所需要的文件</p>
			<font color="blue">
			<xmp>
			<link rel="stylesheet" type="text/css" href="http://pic.zbxdev.com/js/jquery-easyui/themes/default/easyui.css">
			<link rel="stylesheet" type="text/css" href="http://pic.zbxdev.com/js/jquery-easyui/themes/icon.css">
			<script type="text/javascript" src="http://pic.zbxdev.com/js/jquery-1.8.0.js"></script>
			<script type="text/javascript" src="http://pic.zbxdev.com/js/jquery-easyui/jquery.easyui.min.js"></script>
			<script type="text/javascript" src="http://pic.zbxdev.com/js/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
			<script type="text/javascript" src="http://pic.zbxdev.com/js/jquery-easyui/extendvalidate.js"></script>
			<link rel="stylesheet" type="text/css" href="http://pic.zbxdev.com/js/jquery-easyui/themes/demo.css">
			</xmp>
			</font>
			功能实现者：
			<p>singePicUpload-1.6.js,在页面中引入此js文件</p>
			<font color="blue">
			<xmp>
				<script type="text/javascript" src="http://pic.zbxdev.com/js/pic/js/singePicUpload-1.6.js"></script>
			</xmp>
			</font>
			<br>
			调用函数格式：<br>
			Supload(按钮id,接收图片文本框id,类型,大图宽度,大图高度,小图宽度,小图高度,回调标记)
			<br>例如：
			<pre>
按照长宽进行缩放：
	Supload('samupPicUpUrl','picUpUrl','pic',125,120);
	40 & 40 为小图的宽和高,最后字符串常量值为标记使用：配置自调用myDis脚本（实现自我业务逻辑）
	Supload('samupPicUpUrl','picUpUrl','pic',-1,160,40,40,'callbackFlag');
按照宽度等比例缩放（高度传 0或负数）：
	Supload('samupPicUpUrl','picUpUrl','pic',160,0);
按照高度等比例缩放（宽度传 0或负数）：
	Supload('samupPicUpUrl','picUpUrl','pic',0,170);
			</pre>
		</span>
	</div><br/>
	
	图片:
	<input type=text id="picUpUrl" name="picUpUrl"> 
	<a onclick="javascript:Supload('samupPicUpUrl','picUpUrl','pic',-1,-1,-1,-1,'callbackFlag');" 
						  id="samupPicUpUrl" class="easyui-linkbutton" iconCls="icon-add">上传图片</a>
	<br>
	<div style="padding-left:5px;">
		<font color="red">图片 code:</font>
		<br>
		<textarea rows="10" cols="100">
	<input type=text id="picUpUrl" name="picUpUrl"/>
		<a onclick="javascript:Supload('samupPicUpUrl','picUpUrl','pic',125,160,40,40,'callbackFlag');" 
							id="samupPicUpUrl" class="easyui-linkbutton" iconCls="icon-add">上传图片</a>
		<input type=text id="picUpUrl" name="picUpUrl"/> 
		<a onclick="javascript:Supload('samupPicUpUrl','picUpUrl','pic',-1,-1,-1,-1,'callbackFlag');" 
						id="samupPicUpUrl" class="easyui-linkbutton" iconCls="icon-add">上传图片</a>
		</textarea>
	</div>	
	
</body>
